package dancrawler.server;

public class Room {

    /*
     * x=max width y=max height Generates rectangular, wall-less room for now
     */
    private int type;
    private GeneratedTile[][] room;
    private GeneratedTile.Connector conn = new GeneratedTile.Connector();
    
    public Room(int xRoomSize, int yRoomSize, int type, int offsetX, int offsetY) {
        
        this.type = type;
        room = new GeneratedTile[xRoomSize][yRoomSize];
        for (int i = offsetX; i < room.length; i++) {
            for (int j = offsetY; j < room[i].length; j++) {
                if (i == offsetX || i == room.length - 1) {
                    room[i][j] = new GeneratedTile(i, j, "wallv", true,null, null);
                } else if (j == offsetY || j == room[0].length - 1) {
                    room[i][j] = new GeneratedTile(i, j, "wallh", true,null,null);
                } else {
                    room[i][j] = new GeneratedTile(i, j, "floor1", false,null,conn);
                }
            }
        }

    }
    
    public GeneratedTile.Connector getConnector(){
        return conn;
    }

    public GeneratedTile[][] getRoom() {
        return room;
    }
}
